home *** CD-ROM | disk | FTP | other *** search
- on playHolidayReminder flashSpriteNum, whichOne, daysLeft, doUpdateStage
- daysLeft = max(daysLeft, 0)
- doSetVar = 1
- doShowDays = 1
- case whichOne of
- 1:
- frameName = "Default"
- doSetVar = 0
- 2:
- frameName = "Thanksgiving"
- varStr = "Thanksgiving"
- var2Str = "Don't be a turkey, call your friends and loved ones."
- 3:
- frameName = "Father"
- varStr = "Father's Day"
- var2Str = "Be sure to call your loved ones."
- 4:
- frameName = "Mother"
- varStr = "Mother's Day"
- var2Str = "Remember to call that special lady!"
- 5:
- frameName = "Fourth"
- varStr = "July 4th"
- var2Str = "Call your friends and celebrate!"
- 6:
- frameName = "Winter"
- varStr = "Happy Holidays"
- var2Str = "Stay warm by talking to your friends and loved ones."
- doShowDays = 0
- end case
- if doShowDays then
- if daysLeft = 0 then
- varStr = "Today is" && varStr
- else
- if daysLeft = 1 then
- varStr = "Tomorrow is" && varStr
- else
- varStr = "Only" && daysLeft && "days until" && varStr
- end if
- end if
- end if
- varStr = varStr & "." & RETURN & var2Str
- if doSetVar then
- setVariable(sprite(flashSpriteNum), frameName, varStr)
- end if
- sprite(flashSpriteNum).goToFrame(frameName)
- if doUpdateStage then
- updateStage()
- end if
- sprite(flashSpriteNum).play()
- end
-
- on decDateIndex d, num, monthDays
- theDay = d mod 100
- theMonth = d / 100 mod 100
- theYear = d / 10000
- theDay = theDay - num
- if theDay < 1 then
- theMonth = theMonth - 1
- if theMonth < 1 then
- theMonth = theMonth + 12
- theYear = theYear - 1
- end if
- theDay = theDay + monthDays[theMonth]
- end if
- theDate = (theYear * 10000) + (theMonth * 100) + theDay
- return theDate
- end
-
- on chooseHolidayReminder flashSpriteNum
- holNameList = ["Default", "Thanksgiving", "Father", "Mother", "Fourth", "Winter"]
- defList = []
- thanksList = [20021128, 20031127, 20041125]
- fatherList = [20020616, 20030615, 20040620]
- motherList = [20020512, 20030511, 20040509]
- julyList = [20020704, 20030704, 20040704]
- holidayList = [20021231, 20031231, 20041231]
- holDateList = [defList, thanksList, fatherList, motherList, julyList, holidayList]
- holRangeList = [0, 13, 13, 13, 13, 30]
- monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
- dateIndex = getDateIndex()
- whichOne = 1
- daysLeft = 0
- numHolidays = holNameList.count()
- repeat with i = 1 to numHolidays
- thisHoliday = holDateList[i]
- numThis = thisHoliday.count()
- repeat with j = 1 to numThis
- lastDate = thisHoliday[j]
- firstDate = decDateIndex(lastDate, holRangeList[i], monthDays)
- put holNameList[i] && firstDate && lastDate
- if (dateIndex >= firstDate) and (dateIndex <= lastDate) then
- whichOne = i
- repeat while 1
- if dateIndex >= lastDate then
- exit repeat
- next repeat
- end if
- daysLeft = daysLeft + 1
- lastDate = decDateIndex(lastDate, 1, monthDays)
- end repeat
- exit repeat
- end if
- end repeat
- if whichOne <> 1 then
- exit repeat
- end if
- end repeat
- playHolidayReminder(flashSpriteNum, whichOne, daysLeft, 0)
- end
-